﻿using System;

namespace Firefly.ExtensionMethods
{
    public static class CharArrayExtensions
    {
        public static byte[] ToByteArray(this char[] obj)
        {
            byte[] byteArray = new byte[obj.Length];

            for (int i = 0; i < obj.Length; i++)
            {
                byteArray[i] = Convert.ToByte(obj[i]);
            }

            return byteArray;
        }
    }
}